<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<title>采样表修复</title>
<script th:src="@{/js/jquery.js}"></script>

</head>
<body>

	<form name="billInfo">
		<table width="100%">
			<tr>
				<td align="center"><h1>采样表修复</h1></td>
			</tr>
		</table>
		<table align="center">
			<tr>

				<td width="190">采样表: <select id="tablePrefix"
					name="tablePrefix">
						<option value="TS_H1_">小时表</option>
						<option value="TS_DAY_">天表</option>
				</select>
				</td>
				<td width="250">开始数据: <input id="startNo" type="number"
					name="startNo" style="width: 120px" />
				</td>
				<td width="201">结束数据: <input id="endNo" type="number"
					name="endNo" style="width: 120px" />
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3" align="right"><input id="StatusRepair"
					type="button" value="采样表修复" onclick="statusRepair()" /></td>
			</tr>
		</table>
		<table>

		</table>
	</form>
</body>


<script type="text/javascript">
	function statusRepair() {
		var tablePrefix = billInfo.tablePrefix.value;
		var startNo = billInfo.startNo.value;
		var endNo = billInfo.endNo.value;
		if (startNo > endNo) {
			alert("起始编号不能大于结束编号！");
		} else {
			$.ajax({
				type : "POST",
				url : "/table_Repair",
				data : JSON.stringify({
					"tablePrefix" : tablePrefix,
					"startNo" : startNo,
					"endNo" : endNo
				}),
				contentType : "application/json",
				success : function(data) {
					if (data.errcode == 200) {
						alert(data.errmsg);
					} else {
						alert("系统异常，联系管理员！");
					}
				}
			});
		}
	}
</script>
</html>